}
return result;
}
-
-pub static ADDING: &'static str = " Adding";
-pub static REMOVING: &'static str = " Removing";
-pub static DOCTEST: &'static str = " Doc-tests";
-pub static PACKAGING: &'static str = " Packaging";
-pub static DOWNLOADING: &'static str = " Downloading";
-pub static UPLOADING: &'static str = " Uploading";
-pub static VERIFYING: &'static str = " Verifying";
-pub static ARCHIVING: &'static str = " Archiving";
-pub static INSTALLING: &'static str = " Installing";
-pub static REPLACING: &'static str = " Replacing";
use cargo::util::{Cfg, CfgExpr};
use hamcrest::assert_that;
-use support::{project, execs, DOWNLOADING};
+use support::{project, execs};
use support::registry::Package;
macro_rules! c {
assert_that(p.cargo_process("build"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry [..]
-{downloading} [..]
-{downloading} [..]
+[DOWNLOADING] [..]
+[DOWNLOADING] [..]
[COMPILING] foo v0.1.0 ([..])
[COMPILING] bar v0.1.0 ([..])
[COMPILING] a v0.0.1 ([..])
-", downloading = DOWNLOADING)));
+")));
});
test!(bad_target_spec {
use std::io::prelude::*;
use support::{project, execs};
-use support::{DOCTEST};
use support::paths::CargoPathExt;
use hamcrest::{assert_that, existing_file, existing_dir};
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
[RUNNING] `rustdoc --test [..]`
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-", doctest = DOCTEST)));
+")));
println!("doc");
assert_that(p.cargo("doc").arg("-v"),
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
[RUNNING] [..] --cfg foo[..]
running 1 test
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-", dir = p.url(), doctest = DOCTEST)));
+", dir = p.url())));
});
test!(cfg_doc {
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
[RUNNING] [..] --cfg foo[..]
running 1 test
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-", dir = p.url(), doctest = DOCTEST)));
+", dir = p.url())));
});
test!(cfg_override_doc {
use std::env;
use support::{project, execs, basic_bin_manifest};
-use support::{DOCTEST};
use hamcrest::{assert_that, existing_file};
use cargo::util::process;
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
running 1 test
test _0 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-", foo = p.url(), doctest = DOCTEST);
+", foo = p.url());
assert_that(p.cargo_process("test"),
execs().with_status(0)
use hamcrest::{assert_that, existing_file, is_not, Matcher, MatchResult};
use support::{project, execs};
-use support::{DOWNLOADING, INSTALLING, REPLACING, REMOVING};
use support::paths;
use support::registry::Package;
use support::git;
assert_that(cargo_process("install").arg("foo"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `[..]`
-{downloading} foo v0.0.2 (registry file://[..])
+[DOWNLOADING] foo v0.0.2 (registry file://[..])
[COMPILING] foo v0.0.2 (registry file://[..])
-{installing} {home}[..]bin[..]foo[..]
+[INSTALLING] {home}[..]bin[..]foo[..]
",
- downloading = DOWNLOADING,
- installing = INSTALLING,
home = cargo_home().display())));
assert_that(cargo_home(), has_installed_exe("foo"));
});
assert_that(cargo_process("install").arg("--force").arg("--path").arg(p.root()),
execs().with_status(0).with_stdout(&format!("\
[COMPILING] foo v0.2.0 ([..])
-{replacing} {home}[..]bin[..]foo[..]
+[REPLACING] {home}[..]bin[..]foo[..]
",
- replacing = REPLACING,
home = cargo_home().display())));
assert_that(cargo_process("install").arg("--list"),
assert_that(cargo_process("install").arg("--force").arg("--path").arg(p.root()),
execs().with_status(0).with_stdout(&format!("\
[COMPILING] foo v0.2.0 ([..])
-{installing} {home}[..]bin[..]foo-bin3[..]
-{replacing} {home}[..]bin[..]foo-bin2[..]
+[INSTALLING] {home}[..]bin[..]foo-bin3[..]
+[REPLACING] {home}[..]bin[..]foo-bin2[..]
",
- installing = INSTALLING,
- replacing = REPLACING,
home = cargo_home().display())));
assert_that(cargo_process("install").arg("--list"),
.arg(p.root()),
execs().with_status(0).with_stdout(&format!("\
[COMPILING] foo v0.2.0 ([..])
-{replacing} {home}[..]bin[..]foo-bin2[..]
+[REPLACING] {home}[..]bin[..]foo-bin2[..]
",
- replacing = REPLACING,
home = cargo_home().display())));
assert_that(cargo_process("install").arg("--list"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] git repository `[..]`
[COMPILING] foo v0.1.0 ([..])
-{installing} {home}[..]bin[..]foo[..]
+[INSTALLING] {home}[..]bin[..]foo[..]
",
- installing = INSTALLING,
home = cargo_home().display())));
assert_that(cargo_home(), has_installed_exe("foo"));
assert_that(cargo_home(), has_installed_exe("foo"));
assert_that(cargo_home(), has_installed_exe("bar"));
assert_that(cargo_process("uninstall").arg("foo").arg("--bin=bar"),
- execs().with_status(0).with_stdout(&format!("\
-{removing} [..]bar[..]
-", removing = REMOVING)));
+ execs().with_status(0).with_stdout("\
+[REMOVING] [..]bar[..]
+"));
assert_that(cargo_home(), has_installed_exe("foo"));
assert_that(cargo_home(), is_not(has_installed_exe("bar")));
assert_that(cargo_process("uninstall").arg("foo").arg("--bin=foo"),
- execs().with_status(0).with_stdout(&format!("\
-{removing} [..]foo[..]
-", removing = REMOVING)));
+ execs().with_status(0).with_stdout("\
+[REMOVING] [..]foo[..]
+"));
assert_that(cargo_home(), is_not(has_installed_exe("foo")));
assert_that(cargo_process("uninstall").arg("foo"),
assert_that(p.cargo_process("build").arg("--release"),
execs().with_status(0));
assert_that(cargo_process("install").arg("--path").arg(p.root()),
- execs().with_status(0).with_stdout(&format!("\
-{installing} [..]
-", installing = INSTALLING)).with_stderr("\
+ execs().with_status(0).with_stdout("\
+[INSTALLING] [..]
+").with_stderr("\
warning: be sure to add `[..]` to your PATH to be able to run the installed binaries
"));
use hamcrest::assert_that;
use support::registry::{registry, Package};
-use support::{execs, project, DOWNLOADING};
+use support::{execs, project};
use support::git;
use support::paths;
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `file://[..]`
[UPDATING] git repository `[..]`
-{downloading} bar v0.2.0 (registry [..])
+[DOWNLOADING] bar v0.2.0 (registry [..])
[COMPILING] foo v0.1.0 (file://[..])
[COMPILING] bar v0.2.0 (registry [..])
[COMPILING] local v0.0.1 (file://[..])
-", downloading = DOWNLOADING)));
+")));
assert_that(p.cargo("build"), execs().with_status(0).with_stdout(""));
});
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `file://[..]`
[UPDATING] git repository `[..]`
-{downloading} [..]
-{downloading} [..]
+[DOWNLOADING] [..]
+[DOWNLOADING] [..]
[COMPILING] [..]
[COMPILING] [..]
[COMPILING] [..]
[COMPILING] local v0.0.1 (file://[..])
-", downloading = DOWNLOADING)));
+")));
});
test!(override_adds_some_deps {
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `file://[..]`
[UPDATING] git repository `[..]`
-{downloading} foo v0.1.1 (registry [..])
+[DOWNLOADING] foo v0.1.1 (registry [..])
[COMPILING] foo v0.1.1 (registry [..])
[COMPILING] bar v0.1.0 ([..])
[COMPILING] local v0.0.1 (file://[..])
-", downloading = DOWNLOADING)));
+")));
assert_that(p.cargo("build"), execs().with_status(0).with_stdout(""));
use tar::Archive;
use support::{project, execs, paths, git, path2url};
-use support::{PACKAGING, VERIFYING, ARCHIVING};
use hamcrest::{assert_that, existing_file};
fn setup() {
assert_that(p.cargo_process("package"),
execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ({dir})
-{verifying} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
",
- packaging = PACKAGING,
- verifying = VERIFYING,
dir = p.url())));
assert_that(&p.root().join("target/package/foo-0.0.1.crate"), existing_file());
assert_that(p.cargo("package").arg("-l"),
"#);
assert_that(p.cargo_process("package"),
execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ({dir})
-{verifying} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
",
- packaging = PACKAGING,
- verifying = VERIFYING,
dir = p.url()))
.with_stderr("\
warning: manifest has no description, license, license-file, documentation, \
"#);
assert_that(p.cargo_process("package"),
execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ({dir})
-{verifying} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
",
- packaging = PACKAGING,
- verifying = VERIFYING,
dir = p.url()))
.with_stderr("\
warning: manifest has no description, documentation, homepage or repository. See \
"#);
assert_that(p.cargo_process("package"),
execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ({dir})
-{verifying} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
",
- packaging = PACKAGING,
- verifying = VERIFYING,
dir = p.url())));
});
println!("package main repo");
assert_that(cargo.clone().arg("package").arg("-v").arg("--no-verify"),
- execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ([..])
-{archiving} [..]
-{archiving} [..]
-",
- packaging = PACKAGING,
- archiving = ARCHIVING)));
+ execs().with_status(0).with_stdout("\
+[PACKAGING] foo v0.0.1 ([..])
+[ARCHIVING] [..]
+[ARCHIVING] [..]
+"));
println!("package sub-repo");
assert_that(cargo.arg("package").arg("-v").arg("--no-verify")
.cwd(p.root().join("a")),
- execs().with_status(0).with_stdout(&format!("\
-{packaging} a v0.0.1 ([..])
-{archiving} [..]
-{archiving} [..]
-",
- packaging = PACKAGING,
- archiving = ARCHIVING)));
+ execs().with_status(0).with_stdout("\
+[PACKAGING] a v0.0.1 ([..])
+[ARCHIVING] [..]
+[ARCHIVING] [..]
+"));
});
test!(package_verification {
execs().with_status(0));
assert_that(p.cargo("package"),
execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ({dir})
-{verifying} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
",
- packaging = PACKAGING,
- verifying = VERIFYING,
dir = p.url())));
});
.file("src/bar.txt", "");
assert_that(p.cargo_process("package").arg("--no-verify").arg("-v"),
- execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ([..])
-{archiving} [..]
-{archiving} [..]
-", packaging = PACKAGING, archiving = ARCHIVING)));
+ execs().with_status(0).with_stdout("\
+[PACKAGING] foo v0.0.1 ([..])
+[ARCHIVING] [..]
+[ARCHIVING] [..]
+"));
});
test!(include {
.file("src/bar.txt", ""); // should be ignored when packaging
assert_that(p.cargo_process("package").arg("--no-verify").arg("-v"),
- execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ([..])
-{archiving} [..]
-{archiving} [..]
-{archiving} [..]
-", packaging = PACKAGING, archiving = ARCHIVING)));
+ execs().with_status(0).with_stdout("\
+[PACKAGING] foo v0.0.1 ([..])
+[ARCHIVING] [..]
+[ARCHIVING] [..]
+[ARCHIVING] [..]
+"));
});
test!(package_lib_with_bin {
assert_that(::cargo_process().arg("package").cwd(p.root())
.arg("--no-verify").arg("-v"),
- execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ([..])
-{archiving} [..]
-{archiving} [..]
-", packaging = PACKAGING, archiving = ARCHIVING)));
+ execs().with_status(0).with_stdout("\
+[PACKAGING] foo v0.0.1 ([..])
+[ARCHIVING] [..]
+[ARCHIVING] [..]
+"));
});
test!(package_git_submodule {
- use std::str::from_utf8;
-
let project = git::new("foo", |project| {
project.file("Cargo.toml", r#"
[project]
repository.reset(&repository.revparse_single("HEAD").unwrap(),
git2::ResetType::Hard, None).unwrap();
- let result = project.cargo("package").arg("--no-verify").arg("-v").exec_with_output().unwrap();
- assert!(result.status.success());
- assert!(from_utf8(&result.stdout).unwrap().contains(&format!("{} bar/Makefile", ARCHIVING)));
+ assert_that(::cargo_process().arg("package").cwd(project.root())
+ .arg("--no-verify").arg("-v"),
+ execs().with_status(0).with_stdout_contains("[ARCHIVING] bar/Makefile"));
});
test!(no_duplicates_from_modified_tracked_files {
assert_that(p.cargo_process("package"),
execs().with_status(0).with_stdout(&format!("\
-{packaging} nested v0.0.1 ({dir})
-{verifying} nested v0.0.1 ({dir})
+[PACKAGING] nested v0.0.1 ({dir})
+[VERIFYING] nested v0.0.1 ({dir})
[COMPILING] nested v0.0.1 ({dir}[..])
",
- packaging = PACKAGING,
- verifying = VERIFYING,
dir = p.url())));
assert_that(&p.root().join("target/package/nested-0.0.1.crate"), existing_file());
assert_that(p.cargo("package").arg("-l"),
use url::Url;
use support::{project, execs};
-use support::{PACKAGING, UPLOADING};
use support::paths;
use support::git::repo;
assert_that(p.cargo_process("publish").arg("--no-verify"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `{reg}`
-{packaging} foo v0.0.1 ({dir})
-{uploading} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[UPLOADING] foo v0.0.1 ({dir})
",
- uploading = UPLOADING,
- packaging = PACKAGING,
dir = p.url(),
reg = registry())));
use std::io::prelude::*;
use support::{project, execs};
-use support::{DOWNLOADING, PACKAGING, VERIFYING, ADDING, REMOVING};
use support::paths::{self, CargoPathExt};
use support::registry::{self, Package};
use support::git;
assert_that(p.cargo_process("build"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `{reg}`
-{downloading} bar v0.0.1 (registry file://[..])
+[DOWNLOADING] bar v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir})
",
- downloading = DOWNLOADING,
dir = p.url(),
reg = registry::registry())));
assert_that(p.cargo_process("build"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `{reg}`
-{downloading} [..] v0.0.1 (registry file://[..])
-{downloading} [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
[COMPILING] baz v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir})
",
- downloading = DOWNLOADING,
dir = p.url(),
reg = registry::registry())));
});
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `{reg}`
-{downloading} notyet v0.0.1 (registry file://[..])
+[DOWNLOADING] notyet v0.0.1 (registry file://[..])
[COMPILING] notyet v0.0.1 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir})
",
- downloading = DOWNLOADING,
dir = p.url(),
reg = registry::registry())));
});
assert_that(p.cargo("package"),
execs().with_status(0).with_stdout(format!("\
-{packaging} foo v0.0.1 ({dir})
-{verifying} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[VERIFYING] foo v0.0.1 ({dir})
[UPDATING] registry `[..]`
-{downloading} notyet v0.0.1 (registry file://[..])
+[DOWNLOADING] notyet v0.0.1 (registry file://[..])
[COMPILING] notyet v0.0.1 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir}[..])
-",
- packaging = PACKAGING,
- verifying = VERIFYING,
- downloading = DOWNLOADING,
- dir = p.url(),
-)));
+", dir = p.url())));
});
test!(lockfile_locks {
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `[..]`
-{downloading} bar v0.0.1 (registry file://[..])
+[DOWNLOADING] bar v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
dir = p.url())));
p.root().move_into_the_past().unwrap();
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `[..]`
-{downloading} [..] v0.0.1 (registry file://[..])
-{downloading} [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
[COMPILING] baz v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
dir = p.url())));
p.root().move_into_the_past().unwrap();
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `[..]`
-{downloading} [..] v0.0.1 (registry file://[..])
-{downloading} [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
[COMPILING] baz v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
dir = p.url())));
});
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `[..]`
-{downloading} bar v0.0.1 (registry file://[..])
-", downloading = DOWNLOADING)));
+[DOWNLOADING] bar v0.0.1 (registry file://[..])
+")));
});
test!(update_lockfile {
println!("0.0.2 build");
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
-{downloading} [..] v0.0.2 (registry file://[..])
+[DOWNLOADING] [..] v0.0.2 (registry file://[..])
[COMPILING] bar v0.0.2 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
dir = p.url())));
println!("0.0.3 update");
println!("0.0.3 build");
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
-{downloading} [..] v0.0.3 (registry file://[..])
+[DOWNLOADING] [..] v0.0.3 (registry file://[..])
[COMPILING] bar v0.0.3 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
dir = p.url())));
println!("new dependencies update");
Package::new("spam", "0.2.5").publish();
assert_that(p.cargo("update")
.arg("-p").arg("bar"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stdout("\
[UPDATING] registry `[..]`
[UPDATING] bar v0.0.3 (registry file://[..]) -> v0.0.4
-{adding} spam v0.2.5 (registry file://[..])
-", adding = ADDING)));
+[ADDING] spam v0.2.5 (registry file://[..])
+"));
println!("new dependencies update");
Package::new("bar", "0.0.5").publish();
assert_that(p.cargo("update")
.arg("-p").arg("bar"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stdout("\
[UPDATING] registry `[..]`
[UPDATING] bar v0.0.4 (registry file://[..]) -> v0.0.5
-{removing} spam v0.2.5 (registry file://[..])
-", removing = REMOVING)));
+[REMOVING] spam v0.2.5 (registry file://[..])
+"));
});
test!(dev_dependency_not_used {
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `[..]`
-{downloading} [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
dir = p.url())));
});
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `[..]`
-{downloading} bar v0.0.1 (registry file://[..])
+[DOWNLOADING] bar v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
[COMPILING] a v0.0.1 ({dir}/a)
[COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
dir = p.url())));
File::create(&p.root().join("a/Cargo.toml")).unwrap().write_all(br#"
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `[..]`
-{downloading} bar v0.1.0 (registry file://[..])
+[DOWNLOADING] bar v0.1.0 (registry file://[..])
[COMPILING] bar v0.1.0 (registry file://[..])
[COMPILING] a v0.0.1 ({dir}/a)
[COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
dir = p.url())));
});
execs().with_status(0).with_stdout(&format!("\
[UPDATING] [..]
[UPDATING] [..]
-{downloading} a v0.0.1 (registry file://[..])
+[DOWNLOADING] a v0.0.1 (registry file://[..])
[COMPILING] a v0.0.1 (registry [..])
[COMPILING] b v0.0.1 ([..])
[COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
dir = p.url())));
p.root().move_into_the_past().unwrap();
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] [..]
-{downloading} a v0.1.1 (registry file://[..])
+[DOWNLOADING] a v0.1.1 (registry file://[..])
[COMPILING] a v0.1.1 (registry [..])
[COMPILING] foo v0.5.0 ({dir})
-", downloading = DOWNLOADING,
+",
dir = p.url())));
});
execs().with_status(0)
.with_stdout(format!("\
[UPDATING] registry `[..]`
-{downloading} a v0.1.0 (registry [..])
-", downloading = DOWNLOADING)));
+[DOWNLOADING] a v0.1.0 (registry [..])
+")));
});
test!(update_transitive_dependency {
assert_that(p.cargo("build"),
execs().with_status(0)
.with_stdout(format!("\
-{downloading} b v0.1.1 (registry file://[..])
+[DOWNLOADING] b v0.1.1 (registry file://[..])
[COMPILING] b v0.1.1 (registry [..])
[COMPILING] a v0.1.0 (registry [..])
[COMPILING] foo v0.5.0 ([..])
-", downloading = DOWNLOADING)));
+")));
});
test!(update_backtracking_ok {
assert_that(p.cargo("build"),
execs().with_status(0)
.with_stdout_contains(format!("\
-{downloading} a v0.1.1 (registry file://[..])", downloading = DOWNLOADING))
+[DOWNLOADING] a v0.1.1 (registry file://[..])"))
.with_stdout_contains(format!("\
-{downloading} b v0.1.1 (registry file://[..])", downloading = DOWNLOADING))
+[DOWNLOADING] b v0.1.1 (registry file://[..])"))
.with_stdout_contains(format!("\
-{downloading} c v0.1.1 (registry file://[..])", downloading = DOWNLOADING))
+[DOWNLOADING] c v0.1.1 (registry file://[..])"))
.with_stdout_contains(format!("\
[COMPILING] a v0.1.1 (registry [..])"))
.with_stdout_contains(format!("\
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `[..]`
-{downloading} baz v0.1.0 ([..])
+[DOWNLOADING] baz v0.1.0 ([..])
[COMPILING] baz v0.1.0 ([..])
[COMPILING] bar v0.5.0 ([..])
-", downloading = DOWNLOADING)));
+")));
});
test!(resolve_and_backtracking {
use std::str;
use support::{project, execs, basic_bin_manifest, basic_lib_manifest};
-use support::{DOCTEST};
use support::paths::CargoPathExt;
use hamcrest::{assert_that, existing_file, is_not};
use cargo::util::process;
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
[RUNNING] `rustdoc --test [..]lib.rs[..]`
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-", dir = p.url(), doctest = DOCTEST)));
+", dir = p.url())));
});
test!(cargo_test_verbose {
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
running 1 test
test foo_0 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
",
- p.url(), doctest = DOCTEST)))
+ p.url())))
});
test!(test_with_deep_lib_dep {
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} bar
+[DOCTEST] bar
running 1 test
test bar_0 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
",
- doctest = DOCTEST,
dir = p.url())));
});
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
",
- p.url(), doctest = DOCTEST)))
+ p.url())))
});
test!(external_test_implicit {
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-", p.url(), doctest = DOCTEST)))
+", p.url())))
});
test!(dont_run_examples {
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
",
- doctest = DOCTEST,
dir = p.url())));
assert_that(p.cargo("test").arg("foo"),
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-",
- doctest = DOCTEST)));
+")));
});
// Regression test for running cargo-test twice with
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
",
- p.url(), doctest = DOCTEST)))
+ p.url())))
});
test!(lib_with_standard_name {
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} syntax
+[DOCTEST] syntax
running 1 test
test foo_0 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-",
- doctest = DOCTEST, dir = p.url())));
+", dir = p.url())));
});
test!(lib_with_standard_name2 {
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
",
- doctest = DOCTEST,
dir = p.url())));
assert_that(p.cargo("test"),
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-",
- doctest = DOCTEST)));
+")));
});
test!(test_then_build {
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
",
- doctest = DOCTEST,
dir = p.url())));
assert_that(p.cargo("build"),
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-{doctest} d1
+[DOCTEST] d1
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-", dir = p.url(),
- doctest = DOCTEST)));
+", dir = p.url())));
});
test!(example_bin_same_name {
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
running 1 test
test foo_0 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-", doctest = DOCTEST)))
+")))
});
test!(dashes_to_underscores {
assert_that(p.cargo_process("test"),
execs().with_stdout(format!("\
[COMPILING] foo v0.0.1 ([..])
-{doctest} foo
+[DOCTEST] foo
running 1 test
test foo_0 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-", doctest = DOCTEST)));
+")));
});
test!(dylib_doctest2 {
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
running 1 test
test _0 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-", doctest = DOCTEST)))
+")))
});
test!(dev_dep_with_build_script {
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-{doctest} foo
+[DOCTEST] foo
running 1 test
test sub_one_0 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-", doctest = DOCTEST)))
+")))
});
test!(test_multiple_packages {